import http from "@/api/http";

export const DetectionHealth = () => {return http({
    url: '/detection/health',
    method: 'get'
})}

export const RoomList = (params) => {return http({
    url: '/room/list',
    method: 'get',
    responseType: 'json',
    params,
})}

export const Login = (data) => {return http({
    url: '/acc/login',
    method: 'post',
    responseType: 'json',
    data,
})}

export const Oneself = () => {return http({
    url: '/acc/oneself',
    method: 'post',
    responseType: 'json',
})}

export const Topup = (amount) => {return http({
    url: '/acc/topup/' + amount,
    method: 'post',
    responseType: 'json',
})}

export const UpdatePassword = (data) => {return http({
    url: '/acc/update/password',
    method: 'post',
    responseType: 'json',
    data,
})}

export const Register = (data) => {return http({
    url: '/acc/register',
    method: 'post',
    responseType: 'json',
    data,
})}

export const GenerateOrder = (data) => {return http({
    url: '/order/generate',
    method: 'post',
    responseType: 'json',
    data,
})}

export const PurchaseOrder = (orderCode) => {return http({
    url: '/order/purchase/' + orderCode,
    method: 'post',
    responseType: 'json',
})}

export const OrderList = () => {return http({
    url: '/order/list',
    method: 'post',
    responseType: 'json',
})}
export const OrderRefund = (orderCode) => {return http({
    url: '/order/refund/' + orderCode,
    method: 'post',
    responseType: 'json',
})}
export const CommentListByRoomCode = (roomType) => {return http({
    url: '/comment/list/' + roomType,
    method: 'post',
    responseType: 'json',
})}
export const CommentAdd = (roomType, comment) => {return http({
    url: '/comment/add/' + roomType + '/' + comment,
    method: 'post',
    responseType: 'json',
})}
export const AdminLogin = (data) => {return http({
    url: '/admin/login',
    method: 'post',
    responseType: 'json',
    data
})}
export const AdminRooms = () => {return http({
    url: '/admin/room',
    method: 'post',
    responseType: 'json'
})}
export const AdminRoomUpdate = (data) => {return http({
    url: '/admin/room/update',
    method: 'post',
    responseType: 'json',
    data
})}
export const AdminRoomAdd = (data) => {return http({
    url: '/admin/room/add',
    method: 'post',
    responseType: 'json',
    data
})}
export const AdminRoomDisable = (roomCode, disable) => {return http({
    url: '/admin/room/disable/' + roomCode + '/' + disable,
    method: 'post',
    responseType: 'json'
})}
export const AdminOrderListByReverse = (phone) => {return http({
    url: '/admin/order/list/reverse/' + phone,
    method: 'post',
    responseType: 'json'
})}
export const AdminOrderUpdateByReverse = (orderCode) => {return http({
    url: '/admin/order/update/reverse/' + orderCode,
    method: 'post',
    responseType: 'json'
})}
export const AdminRoomUpdateByRefund = (orderCode) => {return http({
    url: '/admin/room/update/refund/' + orderCode,
    method: 'post',
    responseType: 'json'
})}
export const AdminHotelInfo = () => {return http({
    url: '/admin/hotel/info',
    method: 'post',
    responseType: 'json'
})}
export const AdminUpdateHotelInfo = (data) => {return http({
    url: '/admin/hotel/update/info',
    method: 'post',
    responseType: 'json',
    data
})}
export const AdminUpdatePassword = (data) => {return http({
    url: '/admin/update/password',
    method: 'post',
    responseType: 'json',
    data
})}

export const HotelInfo = () => {return http({
    url: '/hotel/info',
    method: 'get',
    responseType: 'json'
})}

export const SlideshowImages = () => {return http({
    url: '/slideshow/list',
    method: 'get',
    responseType: 'json',
})}

